package com.dataextend.service.impl;

import com.dataextend.mapper.cluster.RolePermissionDao;
import com.dataextend.entity.RolePermissionEntity;
import com.dataextend.service.RolePermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RolePermissionServiceImpl implements RolePermissionService {

    @Autowired
    private RolePermissionDao rolePermissionDao;

    @Override
    public int add(RolePermissionEntity rolePermissionEntity) {
        return rolePermissionDao.add(rolePermissionEntity);
    }

    @Override
    public int update(RolePermissionEntity rolePermissionEntity) {
        return rolePermissionDao.update(rolePermissionEntity);
    }

    @Override
    public void delete(Long id) {
        rolePermissionDao.delete(id);
    }

    @Override
    public RolePermissionEntity queryById(Long id) {
        return rolePermissionDao.queryById(id);
    }

    @Override
    public List<RolePermissionEntity> list(RolePermissionEntity rolePermissionEntity) {
        return rolePermissionDao.list(rolePermissionEntity);
    }

    @Override
    public void deleteRoleId(Long roleId) {
        rolePermissionDao.deleteRoleId(roleId);
    }

    @Override
    public void addRoleIdPermission(Long roleId, Long permissionId) {
        rolePermissionDao.addRoleIdPermission(roleId, permissionId);
    }
}
